# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-altair
pkgver=5.2.0
pkgrel=0
pkgdesc="Declarative statistical visualization library for Python"
url="https://altair-viz.github.io"
arch="noarch"
license="BSD-3-Clause"
depends="
	python3
	py3-jinja2
	py3-jsonschema
	py3-numpy
	py3-pandas
	py3-toolz
	py3-packaging
	py3-typing-extensions
	"
checkdepends="black py3-pytest"
makedepends="py3-gpep517 py3-hatchling"
subpackages="$pkgname-pyc"
source="https://github.com/altair-viz/altair/archive/v$pkgver/altair-$pkgver.tar.gz"
builddir="$srcdir/altair-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# some tests require dataset: https://github.com/altair-viz/vega_datasets
	local _skipped_tests="
		test_examples
		and not test_api
		and not test_display
		and not test_params
		and not test_vegalite_compiler
		and not test_to_dict_with_format_vega
		and not test_to_json_with_format_vega"

	# shellcheck disable=SC2116
	python3 -m pytest -k "not $(echo $_skipped_tests)" \
		--ignore=tests/utils/test_schemapi.py \
		--ignore=tests/test_jupyter_chart.py \
		--ignore=tests/test_transformed_data.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/altair-$pkgver-py3-none-any.whl
}

sha512sums="
46660d6cdc39dc6776aac0f0cee591b83e9886b7d10b819fda13267fc9b0a0ab9ea29df1bf4ef69f2adf9d9f8fe900709049b6a9ec0e3af32f4013a1912a2dc7  altair-5.2.0.tar.gz
"
